import Cookies from 'js-cookie'

const TokenKey = 'HR-sass-project-Token'

const timeKey = 'HR-sass-project-timestamp'

export function getToken () {
    return Cookies.get(TokenKey)
}

export function setToken (token) {
    return Cookies.set(TokenKey, token)
}

export function removeToken () {
    return Cookies.remove(TokenKey)
}

/**
 * 获取本地缓存的时间戳
 */
export function getTimestamp () {
    return Cookies.get(timeKey)
}

/**
 * 在本地缓存设置当前时间戳
 */
export function setTimestamp () {
    Cookies.set(timeKey, Date.now())
}

